<?php
class ErrorController extends Zend_Controller_Action {
    
    public function errorAction() {
        $error = $this->_getParam("error_handler");
        switch ($error->type) {  
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:  
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:  
                $this->getResponse()->setHttpResponseCode(404);  
                $this->view->type = 404;
                return;
                break;  
            default:  
                $this->getResponse()->setHttpResponseCode(500);  
                $this->view->type = 500;
                if (Core_Util::isDebugMode()) {
                    if ( isset($error->exception) ) {
                        Zend_Debug::dump($error->exception);
                    }
                }
                if ( isset($error->exception) ) {
                    Core_Util::log($error->exception);
                }                
                break;  
        }
    }
    
    public function pageNotFoundAction() {
        $this->getResponse()->setHttpResponseCode(404);  
        $this->view->type = 404;
    }
}
?>
